import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    component: ()=>import('@/views/Home.vue'),
    redirect: "/recommend",
    children: [
      {
        path: "recommend",
        component: () => import("@/views/recommend/Recommend.vue"),
        children: [
          {
            path: ":id",
            component: () => import("@/components/common/songs-detail.vue"),
          },
        ],
      },
      {
        path: "singers",
        component: () => import("../views/singer/Singer.vue"),
        children:[
          {
            path:":id",
            component:()=>import('@/views/singer/singer-detail.vue')
          }
        ]
      },
      {
        path: "rank",
        component: () => import("../views/rank/Rank.vue"),
        children: [
          {
            path: ":id",
            component: () => import("@/components/common/songs-detail.vue"),
          },
        ],
      },
      // {
      //   path:'movie',
      //   component:()=>import('../components/movie/Movie.vue')
      // }
    ],
  }
]

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
